import sys
from PyQt5.QtWidgets import QMainWindow,QApplication
from PyQt5.QtGui import QIcon
class MainWindow(QMainWindow):
    def __init__(self,parent=None):
        super(MainWindow,self).__init__(parent)#父类的初始化
        self.resize(400,400)
        self.status=self.statusBar()
        self.status.showMessage("这是状态栏",6000)
        self.setWindowTitle("pyqt window案例")
if __name__ == '__main__':
    app=QApplication(sys.argv)
    app.setWindowIcon(QIcon("panda.jpg"))#给窗口设置图标
    form=MainWindow()#窗口实例
    form.show()#窗口展示
    #退出
    sys.exit(app.exec_())


